% errorRate = comm.ErrorRate('ResetInputPort',true);
% a = [0 0 1 1]';
% a1 = [0 0 1 0]';
% dd=zeros(1,3);
% % b = [0 1 0 1]';
% % b1 = [0 0 0 1]';
% dd=errorRate(a,a1,0);

% A = [1 2 3
%     4 5 6];
% B = reshape(A,2,3)

% parityCheck_matrix = dvbs2ldpc(0.5);               % 创建 DVB-S.2 校验矩阵
% 
% ldpcEncoder = comm.LDPCEncoder(parityCheck_matrix);     % 编码对象
% in11 = randi([0 1],1,32400)';
% 
% codedata = ldpcEncoder(in11);
% 
% ldpcDecoder = comm.LDPCDecoder(parityCheck_matrix);     % 解码对象
% out11 = ldpcDecoder(1-2*codedata);
% 
% isequal(in11,out11);
%  

% errorRate = comm.ErrorRate('ResetInputPort',true);
% berOFDM = zeros(5,3); 
% err = zeros(1,3); 
% A = [0 1 0 1 0 1 0 1]';
% B = [0 1 0 1 0 1 1 1]';
% err=errorRate(A,B,0);
% 
% berOFDM (1,:)= berOFDM (1,:)+err';
% load('data.mat');
% y=harddecode(codedData_out1', parityCheck_matrix, 20);
% %  di = xor(dataBits_in,y');
% %  dii = find(di);
% 
% di = xor(codedData_out1,y');
% dii = find(di);
% 
% ci=xor(dataBits_in,codedData_out1(1:32400));
% cii = find(ci);



% berCOTFS = [0.503337191358025
% 0.503107638888889
% 0.503560956790124
% 0.503998842592593
% 0.504191743827161];
% hold on;
% semilogy(SNR_dB,berCOTFS,'-g'); 
% semilogy(SNR_dB,berCOTFS_MRC(:,1),'-r');             %Plot simulated BER w/ OTFS
% % Plot coded results
% 
% semilogy(SNR_dB,berCOTFS_LMMSE(:,1),'--b');             %Plot simulated BER w/ C-OTFS
% % axis([5 25 0.0005 0.18])
% title(['海洋信道下', num2str(M_mod), '-QAM调制 ', 'BER-SNR']);
% ylabel('BER');
% xlabel('SNR');
% legend('berCOTFS' ,'berCOTFS-MRC','berCOTFS_LMMSE');
% grid on;
% hold off;

 x = [1 2 3 4 5];
 fn = dftmtx(5);
%  fn = fn./norm(fn);
 x_tao = ifft(x)
 x_tao1 = fn'*x'/5
 x_tao2 = fn*x_tao1
 
%  Fn = dftmtx(N);       % Generate the DFT matrix
% Fn = Fn./norm(Fn);    % normalize the DFT matrix
 
